function [A R]=corr2(I)
 [rows,cols]=size(I);
 [x,y] = meshgrid(1:rows,1:cols);
 
 M=64;
 N=360;
 
 F=zeros(M,N);
 
 I1 = I.*((-1).^(x+y));    
 Fp=(fft2(I1));
 magF=(sqrt(real(Fp).^2 + imag(Fp).^2));
 F1=LPM(magF);
 
 [rows,cols]=size(F1);
 [x,y] = meshgrid(1:cols,1:rows);
 It=F1.*((-1).^(x+y));  
 Fp2=fft2(It);
 
 magF = (sqrt(real(Fp2).^2 + imag(Fp2).^2));        % Magnitud de la imagen

 RT=[];
 
 for key=1:100
     g=zeros(M,N);
 RandStream.setDefaultStream(RandStream('mt19937ar','seed',key));
   W=-1 + (1-(-1)).*rand(M/2,N/2);
   W2=upsampled(W);  
  
   W2(W2<=0.5)=0;
   W2(W2>0.5)=1;
   
   % g(33:96,1:360)=W2;
   I2 = W2.*((-1).^(x+y));  
   Rg=fft2(double(I2));
   
   %g(Imgpolar1(:)==1)=Rg(Imgpolar1(:)==1);
   %phaseG=atan2(imag(Rg),real(Rg));             % Fase de la imagen
    
   magG=sqrt(real(Rg).^2 + imag(Rg).^2);
   
   G=conj(Rg);
   
   r=ifft2(Fp2.*G);
   RT(key)=max(max(real(r)));
 end
  
  [a b]=max(RT);
  R=num2str(b);
  A=RT;
end